package com.frame.service.impl;

import com.frame.domain.Leaves;
import com.frame.domain.SysDictData;
import com.frame.domain.SysUser;
import com.frame.domain.SysUserLeaves;
import com.frame.mapper.LeavesMapper;
import com.frame.service.LeavesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LeavesServiceImpl implements LeavesService {

    @Autowired
    LeavesMapper leavesMapper;

    @Override
    public boolean save(Leaves leaves) {
        return leavesMapper.save(leaves);
    }

    @Override
    public Leaves selectById(String id) {
        return leavesMapper.selectById(id);
    }

    @Override
    public boolean updateLeaves(Leaves leaves) {
        return leavesMapper.updateLeaves(leaves);
    }

    @Override
    public List<SysUser> getBanzhang() {
        return leavesMapper.getBanzhang();
    }

    @Override
    public List<SysUser> getDaoyuan() {
        return leavesMapper.getDaoyuan();
    }

    @Override
    public List<SysUser> getJiangshi() {
        return leavesMapper.getJiangshi();
    }

    @Override
    public List<SysDictData> getLeaveType() {
        return leavesMapper.getLeaveType();
    }

    @Override
    public void insertUserLeaves(SysUserLeaves userLeave) {
        leavesMapper.insertUserLeave(userLeave);
    }

    @Override
    public List<SysUserLeaves> myCompletion(Integer userId) {
        return leavesMapper.myCompletion(userId);
    }
}
